<?php defined('BASEPATH') OR exit('No direct script access allowed');?>

<!-- +++++ Tag Edit +++++ -->

<div class="pink">
    <div class="container">
        <div class="row">

            <!-- +++++ 面包屑导航 +++++ -->
            <div class="col-lg-12">
                <ol class="my-breadcrumb">
                    <li><a href="/admin/type">分类管理</a></li>
                    <li class="active">编辑分类</li>
                </ol>
            </div>

            <div class="col-lg-12">
                <div class="my-well">
                    <div class="table-responsive">

                        <!-- +++++ 表单 +++++ -->
                        <form role="form" action="/admin/type/edittype" method="post">
                            <table class="table">
                                <tr>
                                    <td>标签名</td>
                                    <td><input name="name" type="text" class="form-control" value="<?=$type['name']?>"></td>
                                    <input name="id" type="hidden" value="<?=$type['id']?>">
                                </tr>
                                <tr>
                                    <td>操作</td>
                                    <td>
                                        <button type="submit" class="btn btn-danger" onclick="test()">提交</button>
                                        <button type="reset" class="btn btn-danger" >重置</button>
                                    </td>
                                </tr>
                            </table>
                        </form>

                    </div>
                </div>
            </div>

        </div><!-- /row -->
    </div> <!-- /container -->
</div><!-- /white -->

<!-- +++++ 表单验证 +++++ -->
<script type="text/javascript">
    function test()
    {
        $("#a").validate({
            errorElement: "span",
            errorClass: "fa fa-exclamation-circle",
            rules: {
                name: "required"
            },
            messages: {
                name: " 请输入分类名"
            }
        });
    }
</script>